Next: , Previous: List Answer 2, Up: Answers to Exercises


3.7.21 List Tutorial Exercise 3

Move to one end of the list and press C-@ (or C-<SPC> or whatever) to set the mark, then move to the other end of the list and type C-x * g.

     1:  [2.3, 6, 22, 15.1, 7, 15, 14, 7.5, 2.5]
         .

To make things interesting, let's assume we don't know at a glance how many numbers are in this list. Then we could type:

     2:  [2.3, 6, 22, ... ]     2:  [2.3, 6, 22, ... ]
     1:  [2.3, 6, 22, ... ]     1:  126356422.5
         .                          .

         <RET>                        V R *

     2:  126356422.5            2:  126356422.5     1:  7.94652913734
     1:  [2.3, 6, 22, ... ]     1:  9                   .
         .                          .

         <TAB>                        v l                 I ^

(The I ^ command computes the nth root of a number. You could also type & ^ to take the reciprocal of 9 and then raise the number to that power.)